package com.axjy.his.service.impl;

import com.axjy.his.mapper.RoleMapper;
import com.axjy.his.mapper.UserMapper;
import com.axjy.his.pojo.Role;
import com.axjy.his.pojo.User;
import com.axjy.his.service.RoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by lenovo on 2017/11/6.
 */
@Service("roleService")
@Transactional
public class RoleServiceImpl implements RoleService {

    @Resource
    private RoleMapper rolema;

    @Resource
    private UserMapper user;

    public List<Role> selectAllRole() {
        return rolema.selectAllRole();
    }

    public void add(Role role) {
        rolema.add(role);
    }

    public List<User> searchUserByRole(Integer id) {
        return user.searchUserByRole(id);
    }
}
